<?php
require('./View/Security.php');
require('./View/ViewFunctions.php');
require('./Controller/AdminCheck.php');

function makeTable($table, $id) {
	echo "<select name=\"$id\">";
	
 	echo "<option value=\"\" > Leave unmodified</option>";
	echo createDropDownBox(makeQuery($table), "", 'id');
    echo "</select>";
}
 function makeQuery($table) {
 	return "SELECT Name, id FROM " . $table . " ORDER BY Name ASC";
 }
	$primaryKey= 'id';

?>
<form name="update" action="Merge.php" method="post">

Change all tubes that match the exact criteria below
<table>
<tr>
<td>
Cell Type:
</td>
<td>
Modification:
</td>
<td>
Researcher
</td>
</tr>
<tr>
<td>
<?php makeTable('CellType', 'change[remove][CellTypeID]') ?>
</td>
<td>

<?php makeTable('Modification', 'change[remove][ModifiedByID]') ?>
</td>
<td>

<?php makeTable('Researcher', 'change[remove][FrozenByID]') ?>
</td>
<tr>
<td>
To this exact criteria
<td>
</tr>
<tr>
<td>

<?php makeTable('CellType', 'change[update][CellTypeID]') ?>
</td>
<td>

<?php makeTable('Modification', 'change[update][ModifiedByID]') ?>
</td>
<td>
<?php makeTable('Researcher', 'change[update][FrozenByID]') ?>
</td>
</table>
<input type="hidden" name="table" value="FrozenTube">
<input type="submit" name="true" value="Update">
</form>